<script type="text/javascript" src="__PUBLIC__/js/calendar.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.min.js"></script>
<style type="text/css">
	.st-dtitle .right {
		display: none;
	}
	.st-dtitle {
		text-align: center;
	}
	.st-dtitle span {
		line-height: 30px;
		cursor: pointer;
	}
	.schedule div.mv-container {
		min-height: 210px;
	}

</style>
	<script type="text/javascript">
		function showdata(){
			$("ul.event_list").html("");
			y = $("#year").val();
			m = $("#month").val();
			$("#panel").html(y + "年" + m + "月");
			start_date1 = $("#UL0").attr("class").substr(4);			
			end_date1 = $("#UL41").attr("class").substr(4);
			$.getJSON("{:U('json')}", {
				start_date : start_date1,
				end_date : end_date1
			}, function(data) {
				count = 0;
				prev_date = '';
				if (data != null) {
					$.each(data, function(i) {
						html = '<li id=li_' + data[i].id + ' style=background-color:' + schedule_bg(data[i].priority) + ">";
						html += '<i class="ico_square"></i>';
						html += '<span class="event_time">' + data[i].start_date + '</span>';
						html += ' <p id=' + data[i].id + ' class="event_msg" title="' + data[i].name + '">';
						html += data[i].name;
						html += ' </p>';
						html += "</li>";
						prev_date = data[i].start_date;
						$("ul.event_list").append(html);
					})
				}
			});
		}

		function add() {
			window.open("{:U('add')}", "_self");
		}

		function month_view() {
			window.open("__URL__", "_self");
		}

		function day_view() {
			window.open("{:U('day_view')}", "_self");
		}


		$(document).ready(function() {
			initial();
			set_return_url();
			$("#cm div").click(function() {
				$("#cm div.active").removeClass("active");
				$(this).addClass("active");
			});

			$("p.event_msg").on("click", (function() {
				var msg_list = "";
				current = $(this).attr('id');
				$("p#" + current).parent().parent().find('p.event_msg').each(function() {
					msg_list += $(this).attr("id") + "|";
				});
				winopen("{:U('read')}?id=" + $(this).attr('id') + "&list=" + msg_list,730,490);
			}))
			$("#dialog2").mouseleave(function() {
				$("#dialog2").hide();
			});
			$("li.all").on("click", (function() {
				$(this).parent().find("li.all").hide();
				html = $(this).parent().html();
				$(this).parent().find("li.all").show();
				html = $("<ol></ol>").html(html);
				$("#dialog2").html(html);
				$("#dialog2").css("left", $(this).parents("td").offset().left);
				$("#dialog2").css("top", $(this).parents("td").offset().top);
				$("#dialog2").show();
			}))
		})
		//-->
	</script>